<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<link type="text/css" href="css/jquery-ui-1.8.20custom.css"
		rel="stylesheet" />
</h:head>

<h:body style="background-color: #e3fff6;">



	<h:form id="form01">

		<p:panel header="Cadastro de Roupa" style="font-size:13px;">
			<p:growl id="growl" autoUpdate="true" showDetail="false"
				sticky="true" />


			<h:panelGrid id="Cadastro" columns="6" cellpadding="5">

				<h:outputText value="Nome da Roupa:" />
				<p:inputText value="#{roupaMB.roupa.nome}" />

			</h:panelGrid>

			<p:commandButton value="Salvar" action="#{roupaMB.salvar}"
				actionListener="$bean.clearValues" update="form01"
				style="font-size:13px;">
				<f:ajax execute="@form" render="@form" />
			</p:commandButton>

			<p:commandButton value="Excluir" action="#{roupaMB.excluir}"
				actionListener="$bean.clearValues" update="form01"
				style="font-size:13px;">
				<f:ajax execute="@form" render="@form" />
			</p:commandButton>

			<p:link outcome="menu.jsf" value="Voltar ao Menu">
			</p:link>


			<p:panel header="Lista de Roupa" style="font-size:13px;">
				<p:dataTable var="c" value="#{roupaMB.roupaList}">

					<p:column>
						<f:facet name="header">Roupa:</f:facet>
    				#{c.nome}
			</p:column>
					<p:column>
						<f:facet name="header">Editar</f:facet>
						<p:commandButton process="@this" value="Editar" update=":form01">
							<f:setPropertyActionListener target="#{roupaMB.roupa}"
								value="#{c}" />
						</p:commandButton>
					</p:column>


				</p:dataTable>

			</p:panel>
		</p:panel>
	</h:form>

</h:body>
</html>